{% extends "base.html" %}
{% block title %}添加课程{% endblock %}
{% block content %}
    <h2>添加课程</h2>
    <form action="{{ url_for('add_course') }}" method="post">

        <div class="form-group">
            <label for="name">课程名称:</label>
            <input type="text" class="form-control" id="name" name="name" required>
        </div>

        <div class="form-group">
            <label for="teacher_id">授课教师:</label>
            <select class="form-control" id="teacher_id" name="teacher_id" required>
                {% for teacher in teachers %}
                <option value="{{ teacher.id }}">{{ teacher.username }}</option>
                {% endfor %}
            </select>
        </div>
        <br>

        <button type="submit" class="btn btn-primary">添加</button>
    </form>
    <br>

    <a href="{{ url_for('list_courses') }}" class="btn btn-secondary">返回课程列表</a>
    
{% endblock %}
